Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ


Displaying Rendered β€’ View raw β€’ Download

specs/006-kmp-project-structure/plan.md 936be3998f0fe49f58b8a0f9ff2c01e3cbd85609 (936be399) Text, 4.66 KB

Implementation Plan: KMP Recommended Project Structure Alignment

Branch: T383838020-kmp-project-structure | Date: 2025-07-15 | Spec: T383838specs/006-kmp-project-structure/spec.md
Input: Feature specification from T383838specs/006-kmp-project-structure/spec.md

Summary

Migrate 27 KMP modules from legacy T383838android {} blocks inside T383838kotlin {} to the recommended T383838kotlin.androidLibrary {} top-level DSL. The project already runs AGP 9.2.1 and applies T383838com.android.kotlin.multiplatform.library via convention plugins β€” the primary work is DSL migration in individual module T383838build.gradle.kts files and hardening the convention plugin helper T383838configureKotlinMultiplatform() to absorb common settings (like T383838androidResources.enable = false and T383838withHostTest {}) so modules need fewer per-module overrides. Build verification at each step is critical.

Technical Context

Language/Version: Kotlin 2.3+ targeting JDK 21 (JDK 17 for published modules)
Primary Dependencies: AGP 9.2.1, Kotlin Multiplatform Gradle Plugin, T383838com.android.kotlin.multiplatform.library
Storage: N/A (build infrastructure only)
Testing: T383838./gradlew assembleDebug :desktop:packageUberJarForCurrentOS allTests for build verification
Target Platform: Android (API 26+) + Compose Desktop (JVM)
Project Type: Mobile app (KMP) β€” build infrastructure change
Performance Goals: Build time must not increase >5% (NFR-001)
Constraints: Configuration cache, isolated projects, parallel execution must remain functional (NFR-002)
Scale/Scope: 27 KMP modules across T383838core/ (19) and T383838feature/ (8), plus 4 convention plugin files in T383838build-logic/

Constitution Check

GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.

β€’ I. Kotlin Multiplatform Core: βœ… PASS β€” No source files are modified. All changes are to T383838build.gradle.kts configuration files and convention plugin Kotlin files in T383838build-logic/. Business logic in T383838commonMain is untouched. The migration moves Android target configuration from T383838kotlin { android {} } to T383838kotlin { androidLibrary {} } β€” a pure DSL change with identical semantics.

β€’ II. Zero Lint Tolerance: βœ… PASS β€” Verification commands:
β€’ T383838./gradlew spotlessApply spotlessCheck (formatting)
β€’ T383838./gradlew detekt (static analysis)
β€’ Convention plugin files in T383838build-logic/ are covered by the T383838:build-logic:convention:spotlessCheck and T383838:build-logic:convention:detekt tasks.

β€’ III. Compose Multiplatform UI: βœ… N/A β€” No UI changes. This is a build infrastructure change only.

β€’ IV. Privacy First: βœ… PASS β€” No runtime behavior changes. No PII exposure. T383838core/proto submodule not modified.

β€’ V. Design Standards Compliance: βœ… N/A β€” No user-facing UI changes. Cross-Platform Spec: N/A β€” build infrastructure change.

β€’ VI. Verify Before Push: βœ… β€” Local verification commands:
T282828
./gradlew spotlessApply spotlessCheck detekt assembleDebug :desktop:packageUberJarForCurrentOS allTests
Te6edf3DESKTOP_ONLYTff7b72=Tffa657true ./gradlew :desktop:packageUberJarForCurrentOS

Post-push: T383838gh pr checks <PR> or T383838gh run list --branch 020-kmp-project-structure --limit 5

Project Structure

Documentation (this feature)

T282828
specs/006-kmp-project-structure/
β”œβ”€β”€ plan.md # This file
β”œβ”€β”€ research.md # Phase 0: DSL migration research
β”œβ”€β”€ data-model.md # Phase 1: Module classification and migration matrix
β”œβ”€β”€ quickstart.md # Phase 1: Step-by-step migration guide
└── tasks.md # Phase 2 output (/speckit.tasks command)

Source Code (repository root)

T282828
build-logic/convention/src/main/kotlin/
β”œβ”€β”€ KmpLibraryConventionPlugin.kt # Convention plugin β€” no changes expected
β”œβ”€β”€ KmpFeatureConventionPlugin.kt # Convention plugin β€” no changes expected
β”œβ”€β”€ KmpJvmAndroidConventionPlugin.kt # Convention plugin β€” no changes expected
└── org/meshtastic/buildlogic/
└── KotlinAndroid.kt # configureKotlinMultiplatform() β€” harden defaults

core/*/build.gradle.kts # 19 KMP modules β€” migrate android {} β†’ androidLibrary {}
feature/*/build.gradle.kts # 8 KMP modules β€” migrate android {} β†’ androidLibrary {}
(excluding feature/widget/ β€” Android-only, not affected)

Structure Decision: Existing module structure is preserved. This change only modifies T383838build.gradle.kts files and convention plugin helpers. No directory restructuring.

Complexity Tracking

β”‚ No constitution violations. No complexity exceptions needed.

Served by rngit 1.5.0 - Generated in 0.04s